<template>

    <div>
        <div v-for="(menu, index) in menus" @click="toPage(menu)">
            {{ menu.name }}
        </div>
    </div>
    <div>
        <router-view></router-view>
    </div>

    <div>
        文件列表
    </div>

</template>

<script setup>
import TopNav from "./TopNav.vue"
import { useRouter, useRoute } from 'vue-router'
const router = useRouter()
let menus = [
    { name: "上传", href: "/file/upload" },
    { name: "下载", href: "/file/download" },
    // { name: "下载", href: "/file/upload" },
    // { name: "注册", href: "/file/register" },
]
const toPage = (menu) => {
    // if (menu.href == "login") {
    //     router.push("/login")
    // } else {
    // }
    // console.log(menu.href);
    router.push(menu.href)
}
</script>

<style lang="scss" scoped>

</style>